﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using System;

namespace ItemComponent
{
    public class Move_Tween : MonoBehaviour
    {
        public void MoveTo(Vector3 pos,float time,DG.Tweening.TweenCallback callback)
        {
            transform.DOKill();

            var tmp= transform.DOMove(pos, time);
            if (callback != null)
                tmp.OnComplete(callback);
        }

        public void Stop()
        {
            transform.DOKill();
        }
    }
}